package com.hxh.rpc.registry;

import com.hxh.rpc.registry.model.ServiceMetaConfig;

/**
 * 注册中心服务接口定义
 * @author hxh
 * @date 2022/3/2
 * @since 1.0
 */
public interface ServiceRegistry {
    /**
     * 注册服务
     * @param serviceMetaConfig 服务元数据配置
     * @throws Exception
     */
    void registry(ServiceMetaConfig serviceMetaConfig) throws Exception;

    /**
     * 取消服务
     * @param serviceMetaConfig 服务元数据配置
     * @throws Exception
     */
    void unRegistry(ServiceMetaConfig serviceMetaConfig) throws Exception;

    /**
     * 服务发现
     * @param serviceName 服务名
     * @return
     * @throws Exception
     */
    ServiceMetaConfig discovery(String serviceName) throws Exception;
}
